// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2005-1-6

#include "stdafx.h"
#include "cmd_dblog.h"

namespace JoyServer
{
;
// class CJoyAsyncCmdDbLog

void CJoyAsyncCmdDbLog::ResponseAdmin(const char* pNote)
{
    CString note;
    note.Format(
        "<root>"
            "<text text_color=\"FFFF0000\">%s</text>"
        "</root>",
        pNote);
    m_room->SendNoteById(m_adminId, note);
}

void CJoyAsyncCmdDbLog::OnExecute()
{
    CJoyMainServer* pServer = m_room->GetServer();

    CJoyDbSession userSaveSess;
    if(!JoyOpenDbSession(pServer, userSaveSess, pServer->m_dbUserSave))
    {
        return;
    }
    CJoyDbCommand addCmd;
    if(!JoyInvokeCommand(pServer, userSaveSess, addCmd,
        L"battle_managelog_room_command_add",
        m_room->m_roomId,
        m_adminId,
        m_command,
        m_userId,
        m_chatText))
    {
        return;
    }
}

} // namespace JoyServer